import {Injectable} from '@angular/core';
import {InterfaceProvider} from "@providers/interface";

/*
  Generated class for the ImageManipulationProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/
@Injectable()
export class ImageManipulationProvider {

  constructor(private ifp: InterfaceProvider) {
    console.log('Hello ImageManipulationProvider Provider');
  }

  imageUpload(item): Promise<any> {
    return this.ifp.post({
      interfaceId: 'csm.distributor.insertfptp',
      data: item || {}
    }).toPromise();
  }

  delImage(item):Promise<any>{
    return this.ifp.post({
      interfaceId: 'csm.distributor.deletefptp',
      data: item || {}
    }).toPromise();
  }

  imagedowablelode(item):Promise<any>{
    return this.ifp.post({
      interfaceId: 'csm.distributor.selectfptp',
      data: item || {}
    }).toPromise().then();
  }
  
}
